import $axios from './index.js'

// 系统模板
function themeList(data) {
  const url = '/theme/install'
  return $axios.get(url, data)
}
// 系统安装
function saveTheme(data) {
  const url = '/theme/installTheme'
  return $axios.post(url, data)
}
// 已安装模板
function installList(data) {
  const url = '/theme/index'
  return $axios.get(url, data)
}
// 模板启用
function themeActive(data) {
  const url = '/theme/active'
  return $axios.post(url, data)
}
// 模板更新
function themeUpdate(data) {
  const url = '/theme/update'
  return $axios.post(url, data)
}
// 模板卸载
function themeUninstall(data) {
  const url = '/theme/uninstall'
  return $axios.post(url, data)
}
// 所有目录
function allFilePath(data) {
  const url = '/theme/allFilePath'
  return $axios.get(url, data)
}
// 所有文件
function allFiles(data) {
  const url = '/theme/allFiles'
  return $axios.get(url, data)
}
// 模板文件
function tmpFile(data) {
  const url = '/theme/tmpFile'
  return $axios.get(url, data)
}
// 源码查看
function fileRead(data) {
  const url = '/themeFile/read'
  return $axios.get(url, data)
}
// 源码编辑
function fileUpdate(data) {
  const url = '/themeFile/update'
  return $axios.post(url, data)
}
// 站点下的模板
function webTempList(data) {
  const url = '/themeFile/active'
  return $axios.get(url, data)
}
// 栏目下的列表页、详情页模板
function tempFiles(data) {
  const url = 'theme/templateFile'
  return $axios.get(url, data)
}
// 模板单独更新
function singleUpdate(data) {
  const url = '/themeFile/singleUpdate'
  return $axios.post(url, data)
}
// 系统模板删除
function deleteTheme(data) {
  const url = '/theme/delete'
  return $axios.post(url, data)
}
export default {
  themeList,
  saveTheme,
  installList,
  themeActive,
  themeUpdate,
  themeUninstall,
  allFilePath,
  allFiles,
  tmpFile,
  fileRead,
  fileUpdate,
  webTempList,
  tempFiles,
  singleUpdate,
  deleteTheme
}
